var htmlwp=require("html-webpack-plugin")
module.exports={
    entry: "./src/main.js",
    output:{
        path: __dirname+"/dist",
        filename: "build.js"
    },
    module:{
        loaders: [
            {
                test: /\.css$/, //处理后缀为.css的文件
                loader: "style-loader!css-loader"
            },
            {
                test: /\.scss$/,
                loader: "style-loader!css-loader!sass-loader"
            },
            {
                test: /\.less$/,
                loader: "style-loader!css-loader!less-loader"
            },
            {
                test: /\.(png|jpg|gif|ttf|svg)$/,
                loader: "url-loader?limit=20000"
            },
            {
                test: /\.js$/, //es6转es5
                loader: "babel-loader",
                exclude: /node_modules/
            },
            {
                test: /.vue$/,
                loader: "vue-loader"
            },
            {
                test: /vue-preview.src.*?js$/,
                loader: 'babel-loader'
            }
        ]
    },
    plugins:[
        new htmlwp({
            title: "首页",
            filename: "index.html",
            template: "template.html"
        })
    ],
    babel:{
        presets: ["es2015"],
        plugins: ["transform-runtime"]
    }
}